<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var sayIt = function (greeting, name, punctuation) {
      return greeting + ', ' + name + (punctuation || '!');
    };
    function partial(fn, str1, str2) {
      return function (str3) {
        console.log(str1, str2, str3);
        return fn(str1, str2, str3)
      }
    }

    console.log(partial(sayIt, 'str1', 'str2')('!!!'));
  </script>
</body>

</html>